<%--
  Created by IntelliJ IDEA.
  User: dailyblue
  Date: 2025/7/15
  Time: 17:31
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" isELIgnored="false" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%
    pageContext.setAttribute("A", "page", 1);
    pageContext.setAttribute("A", "request", 2);
    pageContext.setAttribute("A", "session", 3);
    pageContext.setAttribute("A", "application", 4);
%>
<h3>表达式输出</h3>
<%
    Object a1 = pageContext.getAttribute("A", 1);
    Object a2 = pageContext.getAttribute("A", 2);
    Object a3 = pageContext.getAttribute("A", 3);
    Object a4 = pageContext.getAttribute("A", 4);
    out.print("a1:" + a1 + "<br/>");
    out.print("a2:" + a2 + "<br/>");
    out.print("a3:" + a3 + "<br/>");
    out.print("a4:" + a4 + "<br/>");
%>
<hr/>
<h3>EL表达式输出</h3>
a1:${pageScope.A}<br/>
a2:${requestScope.A}<br/>
a3:${sessionScope.A}<br/>
a4:${applicationScope.A}<br/>
<!--依次从四个容器中寻找，找到输出-->
缩写:${A}
</body>
</html>
